<template>
	<view class="draftBox">
		<view class="image">
			<image src="/static/svg/Mask.svg" mode="aspectFill" v-if="!message.image"></image>
			<image :src="message.image.split(',')[0]" mode="aspectFill" v-else></image>
			<text>{{message.state=='3'?'艺术精品':message.state=='1'?'家装设计':''}}</text>
		</view>
		<view class="right">
			<text class="top two_ellipsis">{{newTitle}}</text>
			<text class="bottom">{{message.day}}天后自动删除</text>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				
			};
		},
		computed:{
			newTitle(){
				if(this.message.title){
					return this.message.title
				}else if(this.message.state=='3'){
					if(this.message.content){
						return this.message.content
					}else if(this.message.image){
						return '分享图片'
					}else{
						return ""
					}
				}else if(this.message.state=='1'){
					if(this.message.image){
						return '分享图片'
					}else{
						return ""
					}
				}else{
					return ""
				}
			}
		},
		props: {
			index: {
				type: Number,
				default: 0
			},
			message:{
				type: Object,
				default(){
					return {}
				}
			}
		},
	}
</script>

<style lang="scss">
.draftBox{
	height: 220rpx;
	width: 750rpx;
	display: flex;
	align-items: center;
	padding-left: 30rpx;
	.image{
		height: 160rpx;
		width: 200rpx;
		min-width: 200rpx;
		position: relative;
		image{
			width: 100%;
			height: 100%;
			display: block;
			border-radius: 8rpx;
		}
		text{
			display: block;
			height: 38rpx;
			line-height: 38rpx;
			padding: 0 8rpx;
			font-size: 22rpx;
			color: #704F29;
			position: absolute;
			right: 0;
			bottom: 0;
			border-bottom-right-radius: 8rpx;
			opacity: 0.8;
			background-color:#D7BD9F ;
			z-index: 2;
		}
	}
	.right{
		height: 160rpx;
		display: flex;
		flex-flow: column;
		justify-content: space-between;
		margin-left: 30rpx;
		padding-right: 23rpx;
		position: relative;
		.top{
			font-size: 30rpx;
			color: #333333;
			letter-spacing: 1rpx;
			line-height: 40rpx;
			text-align: justify;
			position: absolute;
			top: 0;
			width: 466rpx;
		}
		.bottom{
			font-size:24rpx ;
			color: #999999;
			line-height: 24rpx;
			letter-spacing: 1rpx;
			position: absolute;
			bottom: 0;
			width: 466rpx;
		}
	}
}
</style>
